#!/usr/bin/python
# -*- coding: utf-8 -*-
# CreateDate: 2018-1-10

from manager import pushNotifications
from flask import request, jsonify
from flask_restful import Resource
# from manager.models import db, GateTrade
from gate import gateManager


class Hello(Resource):
    def get(self):
        alert = request.args.get("alert")
        if alert is not None:
            pushNotifications.all(alert)
        else:
            pushNotifications.all()
        return {"message": "Hello, World!"}

    # def post(self):
    #     tradeList = gateManager.get_tradeHistory_list(pair_name='eos_usdt')
    #     if len(tradeList) == 0:
    #         return {'message': '查询失败'}, 400
    #     # Validate and deserialize input
    #     result = dao.insertBatch(tradeList)
    #
    #     return {"status": 'success', 'data': str(result) }, 201
